﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="initial.aspx.cs" Inherits="AnyOffice.general.system.address.initial" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>通讯录</title>
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		
		<script>
function add_detail(address_id)
{
// URL="address_detail.aspx?address_id="+address_id;
// myleft=(screen.availWidth-500)/2;
// window.open(URL,"detail","height=550,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=50,left="+myleft+",resizable=yes");

 var mwidth = "600";
 var mheight = "580";
 var loc_x = parseInt((window.screen.width - mwidth) / 2);
 var loc_y = parseInt((window.screen.height - mwidth) / 2);

 var _oParameter = new Object();
 _oParameter.dialogTitle = "通讯录";
 _oParameter.openFile = "address_detail.aspx?address_id=" + address_id + "&num=" + Math.random();

 window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
  




}

function delete_add(address_id)
{
 msg='确认要删除该联系人么？';
 if(window.confirm(msg))
 {
  URL="address_delete.aspx?address_id=" + address_id;
  window.location=URL;
 }
}

		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
          <div class="main_div">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="tab_ti">
							索引结果 <% = ViewState["NavPromat"] %>
					</td>
				</tr>
			</table>
			<br>
			<asp:Repeater id="rptAddress" runat="server" EnableViewState="False">
				<HeaderTemplate>
					<table border="0" cellspacing="0" width="95%" class="tab_pub" cellpadding="0">
						<tr>
							<td nowrap class="TableHeader" align="center">姓名</td>
							<td nowrap class="TableHeader" align="center">性别</td>
							<td nowrap class="TableHeader" align="center">单位电话</td>
							<td nowrap class="TableHeader" align="center">家庭电话</td>
							<td nowrap class="TableHeader" align="center">手机</td>
							<td nowrap class="TableHeader" align="center">电子邮件</td>
							<td nowrap class="TableHeader" align="center">操作</td>
						</tr>
				</HeaderTemplate>
				<ItemTemplate>
					<tr class="TableLine1">
						<td nowrap align="center"><a href="javascript:add_detail('<%#Eval("AddressId")%>');"><%#Eval("Name")%></a></td>
						<td nowrap align="center"><%#Convert.ToBoolean(Eval("Sex")) == true ? "男" : "女"%></td>
						<td nowrap align="center"><%#Eval("DeptTel")%></td>
						<td nowrap align="center"><%#Eval("HomeTel")%></td>
						<td nowrap align="center"><a title="发送手机短信" href="/general/mobile/new.aspx?mobile=<%#Eval("Mobile")%>"><%#Eval("Mobile")%></a></td>
						<td nowrap align="center"><a href="mailto:<%#Eval("Email")%>"><%#Eval("Email")%></a></td>
						<td nowrap align="center" width="100">
							<a href="javascript:add_detail('<%#Eval("AddressId")%>');"> 详情</a>
							<a href="address_edit.aspx?address_id=<%#Eval("AddressId")%>"> 编辑</a>
							<a href="javascript:delete_add(<%#Eval("AddressId")%>);"> 删除</a>
						</td>
					</tr>
				</ItemTemplate>
				<AlternatingItemTemplate>
				<tr class="TableLine2">
					<td nowrap align="center"><a href="javascript:add_detail('<%#Eval("AddressId")%>');"><%#Eval("Name")%></a></td>
					<td nowrap align="center"><%#Convert.ToBoolean(Eval("Sex")) == true ? "男" : "女"%></td>
					<td nowrap align="center"><%#Eval("DeptTel")%></td>
					<td nowrap align="center"><%#Eval("HomeTel")%></td>
					<td nowrap align="center"><a title="发送手机短信" href="/general/mobile/new.aspx?mobile=<%#Eval("Mobile")%>"><%#Eval("Mobile")%></a></td>
					<td nowrap align="center"><a href="mailto:<%#Eval("Email")%>"><%#Eval("Email")%></a></td>
					<td nowrap align="center" width="100">
						<a href="javascript:add_detail('<%#Eval("AddressId")%>');"> 详情</a>
						<a href="address_edit.aspx?address_id=<%#Eval("AddressId")%>"> 编辑</a>
						<a href="javascript:delete_add(<%#Eval("AddressId")%>);"> 删除</a>
					</td>
				</tr>
				</AlternatingItemTemplate>
				<FooterTemplate>
					</table>
				</FooterTemplate>
			</asp:Repeater>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
            </div>
		</form>
	</body>
</HTML>
